﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace simpleGUI_QLQTPM
{
    public partial class GridToolTip : UserControl
    {
        public GridToolTip()
        {
            InitializeComponent();
        }

        public GridToolTip(string strTenDiaDiem, string strDiaChi, string strLoai, string strKinhDo, string strVido, string strGhiChu)
        {
            InitializeComponent();
            if (null == strTenDiaDiem || null == strDiaChi || null == strLoai || null == strKinhDo || null == strVido || null == strGhiChu)
            {
                return;
            }

            try
            {
                if (strTenDiaDiem.Length > 0)
                {
                    this.lblTenDiaDiem.Text = strTenDiaDiem;
                }

                string strThongTin = String.Empty;

                if (strDiaChi.Length > 0)
                {
                    strThongTin = @"Địa chỉ: ";
                    strThongTin += strDiaChi;
                    strThongTin += "\n";
                }

                if (strLoai.Length > 0)
                {
                    strThongTin += @"Loại hình: ";
                    strThongTin += strLoai;
                    strThongTin += "\n";
                }

                if (strGhiChu.Length > 0)
                {
                    strThongTin += @"Ghi chú: ";
                    strThongTin += strGhiChu;
                }

                this.lblThongTin.Text = strThongTin;
            }
            catch (System.Exception ex)
            {
            	
            }
        }

        public void SetInformation(string strTenDiaDiem, string strDiaChi, string strLoai, string strKinhDo, string strVido, string strGhiChu)
        {
            if (null == strTenDiaDiem || null == strDiaChi || null == strLoai || null == strKinhDo || null == strVido || null == strGhiChu)
            {
                return;
            }

            try
            {
                if (strTenDiaDiem.Length > 0)
                {
                    this.lblTenDiaDiem.Text = strTenDiaDiem;
                }

                string strThongTin = String.Empty;

                if (strDiaChi.Length > 0)
                {
                    strThongTin = @"Địa chỉ: ";
                    strThongTin += strDiaChi;
                    strThongTin += "\n\n";
                }

                if (strLoai.Length > 0)
                {
                    strThongTin += @"Loại hình: ";
                    strThongTin += strLoai;
                    strThongTin += "\n\n";
                }

                if (strGhiChu.Length > 0)
                {
                    strThongTin += @"Ghi chú: ";
                    strThongTin += strGhiChu;
                    strThongTin += "\n\n";
                }

                strThongTin = strThongTin.Remove(strThongTin.Length - 1, 1);

                this.lblThongTin.Text = strThongTin;

                // hien thi avatar
                switch (strLoai)
                {
                    case "ATM":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_ATM;
                        break;
                    case "Bệnh viện":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_hos;
                        break;
                    case "Trường học":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_school;
                        break;
                    case "Quán café":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_coffee;
                        break;
                    case "Quán ăn":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_quan_an;
                        break;
                    case "Trạm xăng":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_fuel_station;
                        break;
                    case "Shop thời trang":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_fashion_shop;
                        break;
                    case "Tiệm hớt tóc":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_barber;
                        break;
                    case "Karaoke":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_karaoke;
                        break;
                    case "Nhà hàng":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_res;
                        break;
                    case "Khách sạn":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_hotel;
                        break;
                    case "Công viên":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_park;
                        break;
                    case "Chợ":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_market;
                        break;
                    case "Rạp chiếu phim":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_cinema;
                        break;
                    case "Sân bóng đá":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_football;
                        break;
                    case "Bến xe":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_bus_station;
                        break;
                    case "Phòng khám":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_clinic;
                        break;
                    case "Bến xe bus":
                        pbAvatar.BackgroundImage = simpleGUI_QLQTPM.Properties.Resources.pic_bus_stop;
                        break;
                }
            }
            catch (System.Exception ex)
            {
            	
            }
        }
    }
}
